home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / linux / tools / gtar10.lha / Makefile < prev    next >
Makefile  |  1992-09-09  |  9KB  |  330 lines

  1. # Makefile for GNU tar program.
  2.  
  3. #SHELL = /bin/sh
  4.  
  5. # In order to disable remote-tape support, add -DNO_REMOTE to the
  6. # appropriate DEFS line, and remove rtape_lib.* from LOCAL_{SRC,OBJ}
  7. # For Ultrix 3.1, you will have to compile rtape_lib.c with -DUSG.
  8. # Add -DUSE_REXEC to use rexec for remote tape operations
  9. # instead of forking rsh or remsh.
  10. #
  11. # If tar fails to properly print error msgs, or core-dumps doing same,
  12. # you may need to change which version of msg...() you are using.
  13. # To do so, add one of the following to your DEFS= line
  14. # -DSTDC_MSG        If you are using an ANSI compiler, and have vfprintf().
  15. # -DVARARGS_MSG        If you have varargs.h and vfprintf()
  16. # -DDOPRNT_MSG        If you have _doprnt(), and no useful varargs support
  17. # -DLOSING_MSG        If nothing else works.
  18. #
  19. # Some non-BSD systems may have to add -DNEED_TZSET in order to have getdate.y
  20. # compile correctly.
  21. #
  22. # If you have a system V system which defines size_t, add -DHAVE_SIZE_T.
  23. # If you have a system which defines strstr, add -DHAVE_STRSTR.
  24. #
  25. # If you can't use remote tar with the rmt library, you can still get
  26. # some stuff to work right by adding -DUSE_REXEC.
  27. #
  28. # Some people's systems define a prototype for signal handlers which
  29. # require them to be declared as void.  If you get such problems in
  30. # rtape_lib, function command, then define -DSIGNAL_VOID.  
  31. #
  32. # getdate.y has 8 shift/reduce conflicts.
  33. #
  34. # In addition to setting DEFS appropriately for your system, you might
  35. # have to hand edit the #defines and #undefs in port.c.
  36. #
  37.  
  38. ## GNU version
  39. #DEFS = -DBSD42
  40. #LOCAL_SRC = 
  41. #LOCAL_OBJ = 
  42. #LDFLAGS =
  43. #LIBS =  -lutils
  44. #LINT = lint
  45. #LINTFLAGS = -abchx
  46. #DEF_AR_FILE = \"-\"
  47. #DEFBLOCKING = 20
  48. #O = o
  49.  
  50. ## Berserkeley version
  51. #CC=gcc
  52. #DEFS = -DBSD42
  53. #LOCAL_SRC = getdate.y  rtape_lib.c
  54. #LOCAL_OBJ = getdate.$O rtape_lib.$O
  55. #LDFLAGS =
  56. #LIBS =
  57. #LINT = lint
  58. #LINTFLAGS = -abchx
  59. #DEF_AR_FILE = \"/dev/rmt8\"
  60. #DEFBLOCKING = 20
  61. #O = o
  62.  
  63. ## amigadog version
  64. CC=gcc2
  65. DEFS = -DBSD42 -DSTDC_MSG -DHAVE_SIZE_T -DHAVE_STRSTR -DSIGNAL_VOID -DNO_REMOTE
  66. LOCAL_SRC = getdate.y
  67. LOCAL_OBJ = getdate.$O
  68. LDFLAGS =
  69. LIBS =
  70. LINT = lint
  71. LINTFLAGS = -abchx
  72. DEF_AR_FILE = "tape:r1000"
  73. DEFBLOCKING = 20
  74. O = o
  75.  
  76. ## Ultrix
  77. #CC=gcc
  78. #DEFS = -DBSD42 -DSIGNAL_VOID
  79. #LOCAL_SRC = getdate.y  rtape_lib.c
  80. #LOCAL_OBJ = getdate.$O rtape_lib.$O
  81. #LDFLAGS =
  82. #LIBS =
  83. #LINT = lint
  84. #LINTFLAGS = -abchx
  85. #DEF_AR_FILE = \"/dev/rmt8\"
  86. #DEFBLOCKING = 20
  87. #O = o
  88.  
  89. # HPUX 7.0 version
  90. #DEFS = -DBSD42 -Dhpux -DVARARGS_MSG
  91. #LOCAL_SRC = getdate.y  rtape_lib.c 
  92. #LOCAL_OBJ = getdate.$O rtape_lib.$O alloca.$O
  93. #LDFLAGS =
  94. #LIBS = -lBSD 
  95. #LINT = lint
  96. #LINTFLAGS = -abchx
  97. #DEF_AR_FILE = \"/dev/rct/c3d0s2\"
  98. #DEFBLOCKING = 20
  99. #O = o
  100.  
  101. # IBM AIX version -- this saves "hidden" directories, but doesn't restore
  102. # them as hidden.  Add -Di386 for a PS/2.  If you don't have GCC, turn it off.
  103. # Some people think you need -lbsd, some don't.  Dunno.
  104. #CC=gcc
  105. #DEFS= -DUSG -Daix -DSTDC_MSG -DHAVE_MTIO -DHAVE_SIZE_T -DSIGNAL_VOID
  106. #LOCAL_SRC =  getdate.y rtape_lib.c
  107. #LOCAL_OBJ =  getdate.$O rtape_lib.$O
  108. #LDFLAGS =
  109. #LIBS = -lbsd
  110. #LINT = lint
  111. #LINTFLAGS = -p
  112. #DEF_AR_FILE = \"/dev/rmt0\"
  113. #DEFBLOCKING = 20
  114. #O = o
  115.  
  116. # USG version
  117. # Add -DNDIR to DEFS if your system uses ndir.h instead of dirent.h
  118. # Add -DDIRECT to DEFS if your system uses 'struct direct' instead of
  119. # 'struct dirent' (this is the case at least with one add-on ndir 
  120. # library)
  121. # Add -DHAVE_MTIO to DEFS if your system has sys/mtio.h and defines MTIOCTOP
  122. # Add -DDAYLIGHT_MISSING to DEFS if your system doesn't define the
  123. # external variable `daylight'.
  124. # Add -lndir to LIBS if your ndir routines aren't in libc.a
  125. # Add -lPW to LIBS if you don't compile with gcc (to get alloca)
  126. #DEFS = -DUSG -DSIGNAL_VOID #-DNDIR -DDIRECT -DHAVE_MTIO
  127. #LOCAL_SRC =  getdate.y rtape_lib.c
  128. #LOCAL_OBJ =  getdate.$O rtape_lib.$O
  129. #LDFLAGS =
  130. #LIBS = #-lndir -lPW
  131. #LINT = lint
  132. #LINTFLAGS = -p
  133. #DEF_AR_FILE = \"/dev/rmt8\"
  134. #DEFBLOCKING = 20
  135. #O = o
  136.  
  137. # UniSoft's Uniplus SVR2 with NFS
  138. #DEFS = -DUSG -DUNIPLUS -DNFS -DSVR2 -DSIGNAL_VOID
  139. #LOCAL_SRC =  getdate.y rtape_lib.c
  140. #LOCAL_OBJ =  getdate.$O rtape_lib.$O
  141. #LDFLAGS =
  142. #LIBS = -lndir
  143. #LINT = lint
  144. #LINTFLAGS = -bx
  145. #DEF_AR_FILE = \"/dev/rmt8\"
  146. #DEFBLOCKING = 20
  147. #O = o
  148.  
  149. # MASSCOMP version
  150. #CC = ucb cc
  151. #DEFS = -DBSD42
  152. #LOCAL_SRC =  getdate.y rtape_lib.c
  153. #LOCAL_OBJ =  getdate.$O rtape_lib.$O
  154. #LDFLAGS =
  155. #LIBS = 
  156. #LINT = lint
  157. #LINTFLAGS = -bx
  158. #DEF_AR_FILE = \"/dev/rmt0\"
  159. #DEFBLOCKING = 20
  160. #O = o
  161.  
  162. # (yuk) MS-DOS (Microsoft C 4.0) version
  163. #MODEL = S
  164. #DEFS = -DNONAMES -A$(MODEL) -DNO_REMOTE
  165. #LOCAL_SRC =  getdate.y rtape_lib.c
  166. #LOCAL_OBJ =  getdate.$O rtape_lib.$O
  167. #LDFLAGS =
  168. #LIBS = $(MODEL)dir.lib
  169. #LINT =    $(CC)
  170. #LINTFLAGS = -W3
  171. #DEF_AR_FILE = \"tar.out\"
  172. #DEFBLOCKING = 20
  173. #O = obj
  174.  
  175. # V7 version
  176. # Pick open3 emulation or nonexistence.  See open3.h, port.c.
  177. ##DEFS = -DV7 -DEMUL_OPEN3 -Dvoid=int
  178. ##DEFS = -DV7 -DNO_OPEN3 -Dvoid=int
  179. #LOCAL_SRC =  getdate.y rtape_lib.c
  180. #LOCAL_OBJ =  getdate.$O rtape_lib.$O
  181. #LDFLAGS =
  182. #LIBS = -lndir
  183. #LINT = lint
  184. #LINTFLAGS = -abchx
  185. #DEF_AR_FILE = \"/dev/rmt8\"
  186. #DEFBLOCKING = 20
  187. #O = o
  188.  
  189. # Minix version
  190. # No lint, so no lintflags.  Default file is stdin/out.  (Minix "tar"
  191. # doesn't even take an "f" flag, it assumes argv[2] is the archive name!)
  192. # Minix "make" doesn't expand macros right, so Minix users will have
  193. # to expand CFLAGS, SRCS, O, etc by hand, or fix your make.  Not my problem!
  194. # You'll also need to come up with ctime(), the directory
  195. # library, and a fixed doprintf() that handles %*s.  Put this stuff in
  196. # the "SUBSRC/SUBOBJ" macro below if you didn't put it in your C library.
  197. # Note that Minix "cc" produces ".s" files, not .o's, so O = s has been set.
  198. #
  199. # Pick open3 emulation or nonexistence.  See open3.h, port.c.
  200. ##DEFS = -DV7 -DMINIX -DEMUL_OPEN3
  201. ##DEFS = -DV7 -DMINIX -DNO_OPEN3
  202. #LOCAL_SRC =  getdate.y rtape_lib.c
  203. #LOCAL_OBJ =  getdate.$O rtape_lib.$O
  204. #LDFLAGS =
  205. #LIBS =
  206. #DEF_AR_FILE = \"-\"
  207. #DEFBLOCKING = 8    # No good reason for this, change at will
  208. #O = s
  209.  
  210. # Xenix version
  211. #DEFS = -DUSG -DXENIX -DSIGNAL_VOID
  212. #LOCAL_SRC =  getdate.y rtape_lib.c
  213. #LOCAL_OBJ =  getdate.$O rtape_lib.$O
  214. #LDFLAGS = 
  215. #LIBS = -lx
  216. #LINT = lint
  217. #LINTFLAGS = -p
  218. #DEF_AR_FILE = \"/dev/rmt8\"
  219. #DEFBLOCKING = 20
  220. #O = o
  221.  
  222. # SGI 4D version
  223. # You will need to define NEED_TZSET in getdate.y
  224. #DEFS = -DUSG -I/usr/include/bsd
  225. #LOCAL_SRC = getdate.y rtape_lib.c
  226. #LOCAL_OBJ =  getdate.$O rtape_lib.$O
  227. #LDFLAGS = 
  228. #LIBS = -lxmalloc
  229. #LINT = lint
  230. #LINTFLAGS = -p
  231. #DEF_AR_FILE = \"/dev/tape\"
  232. #DEFBLOCKING = 20
  233. #O = o
  234.  
  235. #CC = gcc
  236. #TARGET_ARCH = 
  237.  
  238. CFLAGS = $(COPTS) $(ALLDEFS)
  239. ALLDEFS = $(DEFS) \
  240.     -DDEF_AR_FILE=$(DEF_AR_FILE) \
  241.     -DDEFBLOCKING=$(DEFBLOCKING)
  242. # next line for Debugging
  243. #COPTS = -g
  244. # next line for Production
  245. COPTS = -O2 -resident
  246.  
  247. # Add things here like readdir that aren't in your standard libraries.
  248. # (E.g. MSDOS needs msd_dir.c, msd_dir.obj)
  249. SUBSRC=
  250. SUBOBJ=    
  251.  
  252. # Destination directory and installation program for make install
  253. bindir = /usr/local/gnubin
  254. INSTALL = cp
  255. RM = rm -f
  256.  
  257. SRC1 =    tar.c create.c extract.c buffer.c getoldopt.c update.c gnu.c mangle.c
  258. SRC2 =  version.c list.c names.c diffarch.c port.c wildmat.c getopt.c getopt1.c regex.c
  259. SRC3 =  $(LOCAL_SRC) $(SUBSRC)
  260. SRCS =    $(SRC1) $(SRC2) $(SRC3)
  261. OBJ1 =    tar.$O create.$O extract.$O buffer.$O getoldopt.$O list.$O update.$O
  262. OBJ2 =    version.$O names.$O diffarch.$O port.$O wildmat.$O getopt.$O getopt1.$O regex.$O
  263. OBJ3 =  gnu.$O mangle.$O $(LOCAL_OBJ) $(SUBOBJ)
  264. OBJS =    $(OBJ1) $(OBJ2) $(OBJ3)
  265. # AUX =    README PORTING Makefile TODO tar.h port.h open3.h \
  266. #    msd_dir.h msd_dir.c
  267. AUX =   README COPYING ChangeLog Makefile tar.texinfo tar.h port.h open3.h \
  268.     rmt.h msd_dir.h msd_dir.c rtape_server.c rtape_lib.c getdate.y \
  269.     getopt.h regex.h level-0 level-1 backup-specs testpad.c
  270.  
  271. all:    tar rmt
  272.  
  273. tar:    $(OBJS)
  274.     $(CC) $(LDFLAGS) -o tar $(COPTS) $(OBJS) $(LIBS)
  275.  
  276. rmt:    rtape_server.c
  277.     $(CC) $(CFLAGS) $(LDFLAGS) -o rmt rtape_server.c
  278.  
  279. testpad.h: testpad
  280.     testpad > testpad.h
  281.  
  282. testpad: testpad.o
  283.     $(CC) -o testpad testpad.o
  284.  
  285. # command is too long for Messy-Dos (128 char line length limit) so
  286. # this kludge is used...
  287. #    @echo $(OBJ1) + > command
  288. #    @echo $(OBJ2) >> command
  289. #    link @command, $@,,$(LIBS) /NOI;
  290. #    @$(RM) command
  291.  
  292. install: all
  293.     $(RM) $(bindir)/tar
  294.     $(INSTALL) tar $(bindir)/tar
  295.     $(INSTALL) rmt /etc/rmt